Check pointers before xfree.
authoroliskoli <oliskoli>
Sun, 11 Jun 2006 18:23:07 +0000 (18:23 +0000)
committeroliskoli <oliskoli>
Sun, 11 Jun 2006 18:23:07 +0000 (18:23 +0000)
an1.c

diff --git a/an1.c b/an1.c
index 00e4ea73509655e0474b8f3614ddecc7a0b00448..134335ee2021a35002e80b864896c6d1b1adc09e 100644 (file)
--- a/an1.c
+++ b/an1.c
@@ -304,9 +304,9 @@ void Destroy_AN1_Waypoint( void *vwpt ) {
        an1_waypoint_record *wpt = (an1_waypoint_record *)vwpt;
        xfree( wpt->name );
        xfree( wpt->fontname );
-       xfree( wpt->url );
-       xfree( wpt->comment );
-       xfree( wpt->image_name );
+       if ( wpt->url ) xfree( wpt->url );
+       if ( wpt->comment ) xfree( wpt->comment );
+       if ( wpt->image_name ) xfree( wpt->image_name );
        xfree( vwpt );
 }